fix: show no borrowed flag for a language that has none - #456
Merged
Merged
Conversation
Signed-off-by: Arne K. (TRC-Loop) <me@arne.sh>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #440.
The Arabic tile showed Portugal's flag. Not a wrong entry in the table:
flagForhad no entry for Arabic at all, and fell through to the reader's own region, which on a machine listing Portuguese is Portugal. Any language without an entry would have done the same, and Arabic is the only one, so that fallback existed solely to serve it and served it with a flag picked off the user's machine.What it does now
The fallback is gone. A language either has a flag we can name or it has none, and Arabic is given none.
There is no neutral country to choose. Arabic is official across some twenty countries, and picking one would be a statement rather than a fact, whichever it was. A flag chosen at random from the reader's locale list is worse again: it is not even a claim, just noise.
The picker shows a globe where a flag would be, so the tiles stay aligned and the absence reads as chosen rather than as a missing image. Custom user translations already had no flag and now show the same mark, which matches what the module has always said about them belonging to no country.
One thing kept
A reader whose own system is set to
ar-EGorar-MAstill sees that flag. That region is their own setting, not a country picked for them, and it is the same rule that gives anen-USmachine the US flag rather than the union flag. Only borrowing a region from a different language is gone.I had this wrong in the first draft of the test and the test caught it, which is why it is now spelled out in one.
Tests
Five, covering: Arabic gets nothing from an unrelated region, Arabic keeps a region the reader set themselves, the rule is general rather than a special case for one language, and every language that does have a flag still resolves to it. That last one matters because this change narrows what is shown and it would be easy to narrow too far.